home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 003.dms / 003.adf / TEXT / chapter18.txt < prev    next >
Text File  |  1992-09-02  |  3KB  |  145 lines

  1.  
  2.               The Absolute Beginners Guide To Amos
  3.               -------------------------------------
  4.                          Chapter eighteen
  5.                          -----------------
  6.  
  7. If you take a look at EXAMPLE18.Amos you will see it is a small Procedure
  8. that you could use in your programs during development.  
  9.  
  10. The Procedure is called _SYSTEMSTATUS and when called will display the
  11. following information:
  12.  
  13.  
  14. FAST MEMORY FREE
  15.  
  16. CHIP MEMORY FREE
  17.  
  18. DISK SPACE FREE DF0:
  19.  
  20. DISK SPACE FREE DF1:
  21.  
  22. VARIABLE SPACE FREE
  23.  
  24.  
  25. The program is very straight forward and you should have little trouble
  26. understanding it, but as usual I will cover each new command in detail.
  27. This is a good example of why using Procedures can be useful.  You could
  28. build up a library of Procedures which you could use many times over in your
  29. programs saving lots of development time, just like the Pro`s do.
  30.  
  31.  
  32. DFREE
  33. -----
  34. Returns the space left on the currently in use disk in bytes.
  35. For example:
  36.  
  37. PRINT DFREE
  38.  
  39.  
  40. EXIST:
  41. -----
  42. You can use this command to find out if a file or drive EXISTs.
  43. Some examples:
  44.  
  45. IF EXIST (PIC.IFF) THEN LOADIFF etc.......
  46.  
  47. IF EXIST (df1:) THEN DIR$="DF1:"
  48.  
  49.  
  50. DIR$=
  51. -----
  52. Set the current directory or drive.
  53.  
  54. DIR$="DF1:"
  55. Set the current drive to DF1:
  56.  
  57. DIR$="DF0:"
  58. Set the current drive to DF0:
  59.  
  60. DIR$="DF0:PICS/"
  61. Set the directory to PICS drawer of the disk in DF0:
  62.  
  63.  
  64. FAST FREE
  65. ---------
  66.  
  67. PRINT FASTFREE would print the amount of FAST memory available in bytes.
  68.  
  69.  
  70. CHIP FREE
  71. ---------
  72.  
  73. PRINT CHIP FREE would print the amount of CHIP memory available, this can be
  74. used to good effect.  For example, if you wanted to check if the Amiga your 
  75. program was running on had more than 512k then you could do this:
  76.  
  77. IF CHIP FREE+FAST FREE>512*1024 then ...............
  78.  
  79.  
  80. FREE
  81. ----
  82. PRINT FREE informs you of the amount of space you left for variables in your
  83. program.  See SET BUFFER command in chapter 16 if it is low.
  84.  
  85.  
  86. That covers all the new commands that pop up in EXAMPLE18.Amos.  Here are a
  87. few more that may be of use or interest to you.
  88.                            
  89.  
  90.             ---------------------------------------------
  91.  
  92.  
  93. KILL Filename$
  94. --------------
  95. KILL deletes the file in Filename$ from the current drive, once KILLed you 
  96. will not be able to recover this file.  An example:
  97.  
  98. KILL "readme.doc"       Will delete the file readme.doc
  99.  
  100.  
  101.  
  102. RENAME old$ TO new$
  103. -------------------
  104. Allows you to change the name of a file.  As an example let us say we want to
  105. RENAME readme.doc TO instructions.doc, we would execute the following:
  106.  
  107. RENAME readme.doc to instructions.doc
  108.  
  109.  
  110. MKDIR
  111. -----
  112. Creates a drawer (or folder if you like) on the current disk.  As an example
  113. lets say we need a drawer to store our samples in we would:
  114.  
  115. MKDIR "samples"
  116.  
  117.  
  118. LDIR
  119. ----
  120. Lists the current directory of your disk to the printer.
  121.  
  122.   
  123. LLIST
  124. -----
  125. Executing this command will print out your Amos program listing to your
  126. printer.  This command does not work on some versions of Amos.
  127. * See Chapter 20 for how to get round this.
  128.  
  129. LPRINT
  130. ------
  131. You can use this in exactly the same way as PRINT except the output is to 
  132. your printer:
  133.  
  134. LPRINT "THIS TEXT WILL BE SENT TO MY PRINTER"
  135.  
  136.  
  137. OK that is enough new commands for this chapter.  
  138.  
  139.  
  140.  
  141. End of chapter eighteen.
  142.  
  143.  
  144.   
  145.